package com.yuanyefu.jdbc;

import org.hibernate.Query;
import org.hibernate.Session;

import java.util.List;

/**
 * Created by Administrator on 2017/9/18 0018.
 */
public class HQLselectDEMO {
    public static void main(String[] args){
        Session session = HibernateUtil.currentSession();
        Query query = session.createQuery("from Student ");
        List list = query.list();
        for(int i = 0 ; i < list.size(); i++)
        {
            Student name = (Student)list.get(i);
            System.out.println(name);
        }
        HibernateUtil.closeSession();
    }
}
